﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace CaltechSoft.Service.SearchCriteria
{
    public class SectionSearchCriteria
    {
        public string Keyword { get; set; }
        public string TermKeyword { get; set; }

        private readonly IDictionary<string, SearchSortItem> _sortItems;
        public IEnumerable<SearchSortItem> SortItems
        {
            get { return _sortItems.Values; }
        }

        public SectionSearchCriteria()
        {
            _sortItems = new Dictionary<string, SearchSortItem>();
        }

        public SectionSearchCriteria AddSortOrder(string field, SortOrder order)
        {
            if (!_sortItems.ContainsKey(field)) _sortItems.Add(field, new SearchSortItem(field, order));
            return this;
        }
    }

}
